const { ErrorModel } = require('../module/resModel')
const loginCheck = async (ctx, next) => {
  if (ctx.session.username) {
    await next()
    return
  } else {
    ctx.body = new ErrorModel('未登录，无法获取数据，请先登录!')
  }
}
module.exports = loginCheck
